package com.itheima.service;

import com.github.pagehelper.PageInfo;
import com.itheima.domain.Student;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional(readOnly = true)
public interface StudentService {
    /**
     * 添加学生
     * @param student
     * @return
     */
    @Transactional(readOnly = false)
    boolean save(Student student);

    /**
     * 修改学生
     * @param student
     * @return
     */
    @Transactional(readOnly = false)
    boolean update(Student student);

    /**
     * 删除学生
     * @param id
     * @return
     */
    @Transactional(readOnly = false)
    boolean delete(Integer id);

    /**
     * 根据id查找
     * @param id
     * @return
     */
    Student findById(Integer id);

    /**
     * 查询全部
     * @return
     */
    PageInfo<Student> findAll(int page, int size);
}
